package Demo1;
class Out{
    public int a = 5;
    private int b;
    private static int c;
    static class In{

    }
    class In1{
        public int a = 10;
        public int d;
        private int e;
        static final int f = 10;
        public void print(){
            System.out.println(a);//就近原则，优先访问实例内部类的
            System.out.println(Out.this.a);//要访问外部类同名的成员，用 外部类名.this.来访问
            System.out.println("内部类！");
        }
    }
    public void show(){
        In1 in = new In1();
        System.out.println(in.d);
        System.out.println("外部类！");
    }
}
public class Test {
    public static void main(String[] args) {
        Out out = new Out();
        Out.In1 in = out.new In1();

        Out.In1 in1 = new Out().new In1();
    }

    //可以这样理解：有一个类 实现了A接口 并且重写了 B方法
    public static void main1(String[] args) {
        new A(){
            @Override
            public void B() {
                System.out.println("hhhhhh");
            }
        }.B();
        A a = new A() {
            @Override
            public void B() {
                System.out.println("111111");
            }
        };
    }
}
interface A{
    void B();
}
